package com.ccl.iot;

import com.ccl.iot.IOTInterface.IOTIconMonitorInterface.IOTIconChangeListener;
import com.ccl.iot.device.IOTDevice;

public interface IOTInterface {
	public interface IOTListener{
	}
	
	/*
	 * 
	 */
	public interface IOTStructureMonitorInterface extends IOTInterface{
		public interface IOTMemberValueChangeListener extends IOTListener{
			public void onMemberValueChanged(IOTStructureMonitorInterface aSource, String aMember, String aNewValue);
		}
		
		public boolean addMemberValueChangeListener(IOTMemberValueChangeListener aListener);
		public boolean removeMemberValueChangeListener(IOTMemberValueChangeListener aListener);
	}
	
	/*
	 * 
	 */
	public interface IOTStructureArrayMonitorInterface extends IOTStructureMonitorInterface{
		public boolean addMemberValueChangeListener(long aIndex, IOTMemberValueChangeListener aListener);
	}
	
	/*
	 * 
	 */
	public interface IOTMonitorInterface extends IOTInterface{
		public boolean isMonitoring(IOTMonitorInterface aMonitor);
		public int getMonitorListenerCount(IOTMonitorInterface aMonitor);
	}
	
	
	/*
	 * 
	 */
	public interface IOTNameMonitorInterface extends IOTInterface{
		public interface IOTNameChangeListener extends IOTListener{
			public void onNameChanged(IOTDevice aSource, String aNewName);
		}
		
		public boolean addNameChangeListener(IOTNameChangeListener aListener) ;
		public boolean removeNameChangeListener(IOTNameChangeListener aListener);
	}
	/*
	 * 
	 */
	public interface IOTIconMonitorInterface extends IOTInterface{
		public interface IOTIconChangeListener extends IOTListener{
			public void onIconChanged(IOTDevice aSource, String aNewName);
		}
		
		public boolean addIconChangeListener(IOTIconChangeListener aListener) ;
		public boolean removeIconChangeListener(IOTIconChangeListener aListener);
	}
	
	/*
	 * 
	 */
	public interface IOTNameListMonitorInterface extends IOTNameMonitorInterface{
		public boolean addNameChangeListener(long aIndex, IOTNameChangeListener aListener) ;
		public boolean removeNameChangeListener(long aIndex, IOTNameChangeListener aListener) ;
	}
	
	/*
	 * 
	 */
	public interface IOTIconListMonitorInterface extends IOTNameMonitorInterface{
		public boolean addIconChangeListener(long aIndex, IOTIconChangeListener aListener) ;
		public boolean removeIconChangeListener(long aIndex, IOTIconChangeListener aListener) ;
	}
	
	/*
	 * 
	 */
	public interface IOTListMonitorInterface<TYPE> extends IOTInterface {
		public interface IOTListChangeListener<TYPE> extends IOTListener{
			public void onNewObject(IOTListMonitorInterface<TYPE> aSource, TYPE aObject);
			public void onObjectRemoved(IOTListMonitorInterface<TYPE> aSource, TYPE aObject);
		}
		
		public boolean addListChangeListener(IOTListChangeListener<TYPE> aListener);
		public boolean removeListChangeListener(IOTListChangeListener<TYPE> aListener);
	}	
	
	/*
	 * 
	 */
	public interface IOTOnlineMonitorInterface extends IOTInterface{
		public interface IOTOnlineStatusChangeListener extends IOTListener{
			public void onOnlineStatusChanged(IOTDevice aSource, boolean aOnline);
		}
		
		public boolean addOnlineStatusChangeListener(IOTOnlineStatusChangeListener aListener);
		public boolean removeOnlineStatusChangeListener(IOTOnlineStatusChangeListener aListener);
	}
	
	/*
	 * 
	 */
	public interface IOTAuthMonitorInterface extends IOTInterface{
		public interface IOTAuthChangeListener extends IOTListener{
			public void onAuthChanged(IOTDevice aSource, int aNewAuth);
		}
		
		public boolean addAuthChangeListener(IOTAuthChangeListener aListener);
		public boolean removeAuthChangeListener(IOTAuthChangeListener aListener);
	}
	
	/*
	 * 
	 */
	public interface IOTStateMonitorInterface extends IOTInterface{
		public interface IOTStateChangeListener extends IOTListener{
			public void onStateChanged(IOTStateMonitorInterface aSource, int aNewState);
		}

		public boolean addStateChangeListener(IOTStateChangeListener aListener);
		public boolean removeStateChangeListener(IOTStateChangeListener aListener);
	}



}
